package com.updesignsz.api.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 横幅图片
 * Creation date 2020-8-8 15:02:24
 */
@Repository
@Mapper
public interface BannerMapper {


    @Select({"<script>",
            "select b.cover_thumbnail as coverThumbnail, b.cover, a.project_id as projectId, b.type,",
            "b.complete_date as completeDate, b.project_image as projectImage,",
            "b.name, b.owner_name as ownerName, b.area, b.architecture, b.view_design as viewDesign",
            "from banner a inner join projects b on b.id = a.project_id  ",
            "<where>",
            "a.type = 1",
            "AND a.is_removed = 0",
            "AND b.is_removed = 0",
            "</where>",
            "order by a.sequence desc LIMIT 5",
            "</script>"
    })
    List<Map<String, Object>> home();

}